﻿Public Class clsLxjcPgd
    Public Function SelectLxjcPgd(startTime As String, endTime As String) As DataTable
        Dim szSql As String = ""
        szSql &= "SELECT a.*,b.name,c.jp_type FROM sf.b_pgd_lxjc_details a left join sf.t_mst_bz b on a.bz = b.sys_id left join sf.t_prod_spec c on a.support_model = c.prod_spec_id"
        szSql &= " WHERE 1 = 1 "
        szSql &= " and a.factory_id = ? "
        If startTime <> "" Then
            szSql &= " and a.oper_date >= ? "
        End If
        If endTime <> "" Then
            szSql &= " and a.oper_date <= ? "
        End If
        szSql &= " and validity = ? "
        szSql &= " ORDER BY oper_date ASC"
        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, g_factory_id, startTime, endTime, "1")
        If IsNothing(dt) Then
            SelectLxjcPgd = New DataTable
        Else
            SelectLxjcPgd = dt
        End If
    End Function
End Class
